package com.cli.springboot_rabbitmq.controller;

import com.cli.springboot_rabbitmq.provider.DirectProviderService;
import com.cli.springboot_rabbitmq.provider.FanoutProviderService;
import com.cli.springboot_rabbitmq.provider.TopicProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xiongmin
 * @Description
 * @Date 2021/2/26 10:57
 * @Version 1.0
 **/
@RestController
public class SendMessageController {

    @Autowired
    private DirectProviderService directProviderService;
    @Autowired
    private FanoutProviderService fanoutProviderService;
    @Autowired
    private TopicProviderService topicProviderService;


    @GetMapping("/sendDirectMessage/direct")
    public String sendDirectMessageDirect() {
        directProviderService.sendDirectMessage();
        return "ok";
    }

    @GetMapping("/sendDirectMessage/direct/none/exchange")
    public String sendDirectMessageDirectNoneExchange() {
        directProviderService.sendDirectMessageErrorExchange();
        return "ok";
    }

    @GetMapping("/sendDirectMessage/direct/none/queue")
    public String sendDirectMessageDirectNoneQueue() {
        directProviderService.sendDirectMessageErrorQueue();
        return "ok";
    }

    @GetMapping("/sendDirectMessage/fanout")
    public String sendDirectMessageFanout() {
        fanoutProviderService.sendDirectMessage();
        return "ok";
    }

    @GetMapping("/sendDirectMessage/topic")
    public String sendDirectMessageTopic() {
        topicProviderService.sendDirectMessage();
        return "ok";
    }

    @GetMapping("/sendDirectMessage/topic/right")
    public String sendDirectMessageTopicRight() {
        topicProviderService.sendDirectMessageRight();
        return "ok";
    }

    @GetMapping("/sendDirectMessage/topic/error")
    public String sendDirectMessageTopicError() {
        topicProviderService.sendDirectMessageError();
        return "ok";
    }
    @GetMapping("/sendDirectMessage/topic/user")
    public String sendDirectMessageTopicUser() {
        topicProviderService.sendDirectMessageUser();
        return "ok";
    }

}
